<?php
/**
 * Created by PhpStorm.
 * User: ming
 * Date: 17-7-7
 * Time: 上午11:49
 */
class HelloServer
{
    private $serv;

    public function __construct()
    {
        $http = new swoole_http_server('0.0.0.0', 9503, SWOOLE_BASE);
        $http->on('request', function(swoole_http_request $req, swoole_http_response $res) use($http) {
            $res->write("hello world");
            $res->end();
        });
    }

}
// 启动服务器
$server = new HelloServer();